home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / moni / ErrorLog15.lha / ErrorLog / Src / errorlog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-01-06  |  3.1 KB  |  85 lines

  1. /*
  2. **    $RCSfile: errorlog.h,v $
  3. **    $Filename: ErrorLog.h $
  4. **    $Revision: 1.2 $
  5. **    $Date: 2002/01/05 18:14:29 $
  6. **
  7. **    ErrorLog C header file (version 1.2 beta) 
  8. **
  9. **    (C) Copyright 1993-2001 by Etienne Vogt
  10. */
  11.  
  12. #ifndef EXEC_PORTS_H
  13. #include <exec/ports.h>
  14. #endif
  15. #ifndef EXEC_SEMAPHORES_H
  16. #include <exec/semaphores.h>
  17. #endif
  18. #ifndef SANA2_SANA2DEVICE_H
  19. #include <devices/sana2.h>
  20. #endif
  21.  
  22. struct HellGate
  23. {   struct SignalSemaphore  hg_SigSem;    /* Semaphore for arbitration */
  24.     UWORD    hg_LogCount;        /* Number of logged devices */
  25.     struct MsgPort  hg_MsgPort;        /* Message Port for IORequests */
  26.     UWORD    hg_AbortCount;        /* Number of abort Requests */
  27.     struct List  hg_DoomList;        /* List of logged devices */
  28.     UWORD    hg_ErrorCount;        /* Total number of errors */
  29.     ULONG    hg_OpCount;        /* Total number of IOs */
  30.     void    (*hg_PatchBeginIO)();    /* Pointer to patched BeginIO code */
  31.     void    (*hg_PatchAbortIO)();    /* Pointer to patched AbortIO code */
  32.     void    (*hg_DummyCopyBuff)();    /* Pointer to dummy CopyBuff routine */
  33.     APTR    hg_Pool;        /* Memory pool for dynamic structures */
  34. };
  35.  
  36. struct EvilNode
  37. {   struct MinNode  en_Node;        /* Link into list */
  38.     struct IORequest  *en_OrigIOReq;    /* Pointer to Original IORequest */
  39.     struct DoomNode  *en_DoomNode;    /* Pointer to Device DoomNode */
  40.     UBYTE    en_EffectIOReq[0];    /* Effective IORequest goes here */
  41. };
  42.  
  43. #define    DNAME_SIZE    8        /* Size of DoomNode name */
  44. #define DVNAME_SIZE    24        /* Size of exec device name */
  45. #define TNAME_SIZE    32        /* Size of calling task name */
  46.  
  47. struct DoomNode
  48. {   struct Node  dn_Link;        /* Standard Node */
  49.     UWORD    dn_Flags;        /* DoomNode Flags */
  50.     ULONG    dn_UnitNum;        /* Unit number */
  51.     UBYTE    dn_DoomName[DNAME_SIZE]; /* Log Name for device/unit */
  52.     UBYTE    dn_DeviceName[DVNAME_SIZE]; /* Exec device name (not pointer !) */
  53.     UBYTE    dn_DevSubType;        /* Device subtype (mainly for SCSI devices) */
  54.     UBYTE    dn_DevType;        /* Type of device logged (NSD ID) */
  55.     UWORD    dn_IOSize;        /* Size of device's IORequests */
  56.     APTR    dn_OrigBeginIO;        /* Pointer to original BeginIO code */
  57.     APTR    dn_OrigAbortIO;        /* Pointer to original AbortIO code */
  58.     ULONG    dn_OpCount;        /* Device Operation count so far */
  59.     UWORD    dn_ErrorCount;        /* Device Error count so far */
  60.     UWORD    dn_ActiveCount;        /* Number of active Requests */
  61.     struct MinList  dn_Evils;        /* Linked List of active Requests */
  62.     struct IOSana2Req  dn_IOReq;    /* Largest known IORequest yet */
  63.     struct MsgPort  dn_IOPort;        /* IORequest reply port */
  64. };
  65.  
  66. #define    NT_DOOMNODE    (NT_USER)
  67.  
  68. /* DoomNode Flags */
  69.  
  70. #define DNB_ENABLED    0        /* Enable iorequests catching */
  71. #define    DNB_LOGERRORS    1        /* Log errors    */
  72.  
  73. #define DNF_ENABLED    (1L << 0)
  74. #define    DNF_LOGERRORS    (1L << 1)
  75.  
  76. /* Alert defines */
  77.  
  78. #define    AN_ErrorLog    0x70000000
  79. #define AN_elBadMessage    0x70000001    /* Unexpected message at HellGate */
  80. #define AN_elLoggerFail    0x700B0002    /* Couldn't start logger process */
  81. #define AN_elNoHellGate    0x70000003    /* Couldn't find HellGate semaphore */
  82. #define AN_elBadEvilLst    0x70000004    /* Evil List is corrupt */
  83. #define AN_elNoDoomNode    0x70000005    /* Couldn't find DoomNode */
  84. #define AO_ErrorLog    0x00008070
  85.